#include <vector>
class TNode;
using namespace std;
class AST{
public:
	AST();
	~AST();
	TNode* insertTNode(TNode* node);
	TNode* getVarTNode(int index);
	TNode* getProcTNode(int index);
	TNode* getStmtTNode(int line);
	TNode* getConstTNode(int value);
	vector<TNode*> getTNode(char type);  //get TNode by type
	vector<int> isMatch(AST* ast, AST* subast);//find the pattern

private:
	void linkParent(TNode* parent, TNode* child);//used by insertNode
	void linkSibling(TNode* left, TNode* right);//used by insertNode
};